<template>
  <v-app-bar app color="#F5F5F5" elevate-on-scroll dense>
    <v-btn icon @click="$router.go(-1)">
      <v-icon>mdi-chevron-left</v-icon>
    </v-btn>
    <div class="searchBox">
      <v-icon color="#ccc">mdi-magnify</v-icon>
      <input type="text" placeholder="输入商品名称" />
    </div>
    <v-spacer></v-spacer>
    <v-btn icon @click="$router.push('/shoppingCart')">
      <v-badge
        color="pink"
        overlap
        :content="String(this.$store.state.shoppingCartItems.length)"
      >
        <v-icon color="#2AB795" dark>mdi-cart</v-icon>
      </v-badge>
    </v-btn>
  </v-app-bar>
</template>

<script>
export default {
  name: 'goods-list-search-bar'
};
</script>

<style lang="less" scoped>
.searchBox {
  position: relative;
  height: 100%;
  i {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
  }
  input {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #ccc;
    border-radius: 50px;
    text-indent: 30px;
    color: #a0a0a0;
    height: 28px;
    width: 200px;
    line-height: 28px;
    font-size: 13px;
  }
}
</style>
